#include "ScreenImageProvider.h"
#include "ScreenUtils.h"

ScreenImageProvider::ScreenImageProvider()
    : QQuickImageProvider(QQuickImageProvider::Image)
{
}

QImage ScreenImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
{
//    auto instance = ScreenUtils::Instance();

//    if(!instance) return QImage();

//    auto image = instance->CaptureScreen();

    int width = image.width();
    int height = image.height();

    if (size)
        *size = QSize(width, height);

    return this->image;
}
